Skip to content

Issue 337 factory.newBuilder should return new instances #338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 2, 2020
Merged

Issue 337 factory.newBuilder should return new instances #338

merged 4 commits into from
Jun 2, 2020

Conversation

oxbowlakes
Copy link

I hope that this PR is OK. I have added some tests for the correct behaviour in one commit and then a fix for the issue in a second. However, I cannot get the project to compile any tests locally (even before I have made any changes), so I have checked that the test compiles and fails elsewhere using the existing release.

@julienrf
Copy link
Contributor

Thank you @oxbowlakes!

I forgot something, sorry! You have to sign the Scala CLA.

@oxbowlakes
Copy link
Author

That is odd - pretty sure I have contributed before (as I've been through the process several years ago, when contributing to SBT). I have signed the CLA now, not sure how to re-kick the builds

@julienrf
Copy link
Contributor

I’ve restarted the CI, it seems the file compat/src/test/scala/test/scala/collection/FactoryTest.scala is not correctly formatted. Could you please run compat211/Test/scalafmt and commit the changes?

@SethTisue
Copy link
Member

contributing to SBT

(sbt is under the Lightbend CLA; Scala modules are under the Scala CLA)

@oxbowlakes
Copy link
Author

[IJ]sbt:scala-library-compat> compat211/Test/scalafmt
[error] Expected ';'
[error] Not a valid key: scalafmt (similar: scalafix, scalaHome, scala212)
[error] compat211/Test/scalafmt
[error]                        ^

Under the assumption that the vertical alignment was the problem, I have force-pushed a change to the first commit removing it

@julienrf
Copy link
Contributor

Could you please run compat211/Test/scalafmt?

@oxbowlakes
Copy link
Author

As per my previous message, I get an error when I do that, telling me that “scalafmt is not a valid key”

@julienrf
Copy link
Contributor

Sorry, I missed the first part of your message! I forgot that in this project, scalafmt is not available as an sbt-plugin. This means that you have to install it yourself. You can see here the various ways to install it. You can add the scalafmt sbt plugin to the project, locally, just to be able to format from within sbt, or you can install it via coursier, as you prefer. I’m sorry about that, BTW, I wish there was a simpler way… In case you don’t have time to do that, I can manage to reformat the code.

@oxbowlakes
Copy link
Author

I've reopened the project in IDEA and selected the "Use scalafmt" option (it notices the .scalaformat.conf file), put the code back to how it was and reformatted it, and believe that the change I made on Saturday was the correct one (i.e. the scalafmt reformatting has resulted in no changes to commit)

@julienrf
Copy link
Contributor

julienrf commented Jun 2, 2020

Hey @oxbowlakes,
Thanks again for your patience! I’m really sorry about all these troubles, I wish it was easier to run scalafmt in this project… We definitely need to improve the setup.
Maybe one issue came from the fact that there was no scalafmt version in the configuration file. I’ve added it and applied scalafmt again, it removed some newlines in a file.

@julienrf julienrf merged commit c828122 into scala:master Jun 2, 2020
@oxbowlakes
Copy link
Author

oxbowlakes commented Jun 2, 2020

No problem! Thanks for merging the PR - when will a new version of the library be published?

@julienrf
Copy link
Contributor

julienrf commented Jun 2, 2020

That’s a good question! There is an ongoing discussion about that in #331. I believe we should be able to publish a patch release soon.

@ijuma
Copy link
Contributor

ijuma commented Jul 3, 2020

Seems like things stalled a bit in #331. Any thoughts on how to unblock it?

@lrytz
Copy link
Member

lrytz commented Jul 6, 2020

Yeah, we need to take a decision and unblock this repo soon. It's on my to-do list.

repeated references generating new builders, thus this expression
must be non-strict
*/
def builder: m.Builder[A, CC[A]] = fact match {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could probably optimise this so that it doesn't have to pattern match each time, and only does so once

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants